<?php
class Zobrazjedlo extends CI_Controller {

	public function __construct()
	{
		parent::__construct();
		$this->load->model('news_model');
		$this->load->model('project_model');
		$this->load->model('jedalnicek_model');
		$this->load->model('register_pacient_model');
		$this->load->model('register_personal_model');
		$this->load->model('auth_model');
		$this->load->model('dieta_model');
		$this->load->model('Zobrazjedlo_model');
	}
	
	public function index($slug)
	{
		if (!empty($_POST)) {
			if ($this->session->userdata('pacient') != 'empty')
				redirect('jedalnicek/vypis/'.$this->session->userdata('pacient'));
			else
				redirect('pacienti');
		}
		$data['ingrediencie'] = $this->Zobrazjedlo_model->get_items($slug);
		$data['name'] = $this->Zobrazjedlo_model->get_name($slug);
		
		$data['title'] = "NIS - ".$this->Zobrazjedlo_model->get_name($slug);
		
		$this->load->view('templates/header', $data);
		$this->load->view('project/zobrazjedlo_view', $data); 	
		$this->load->view('templates/footer');
	}
}